/// <reference path="../_all.ts" />

module Application.Utility {
    export class String {
        private _value: string;

        constructor(value: string) {
            this._value = value;
        }

        public format(...strings: string[]) {
            var args = strings;
            return this._value.replace(/{(\d+)}/g, function (match, number) {
                return typeof args[number] != 'undefined'
                    ? args[number]
                    : match;
            });
        }
    }
};
